const mongoose = require('mongoose')
const Schema = mongoose.Schema
mongoose.connect('mongodb://localhost/blog')

const blogSchema = new Schema({
    title: {
        type: String,
    },
    imgUrl: {
        type: String,
    },
    text: {
        type: String,
    },
    date: {
        type: String,
        default: Date.now()
    },
    top: {
        type: Number,
        default: 0
    },
    trample: {
        type: Number,
        default: 0
    }
})

const Blog = mongoose.model('blogs', blogSchema)
module.exports = Blog